package com.uzai.common.enums;

/**
 * @author jianghan
 * @date 2018-02-08 15:37
 */
public enum PayStatus {
    SUCCESS(1,"成功"),
    FAIL(2,"失败"),
    IN_HAND(3,"处理中"),
    NOT_PAY(4,"未支付");
    private Integer value;
    private String desc;
    PayStatus(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }
    public Integer getValue() {
        return value;
    }
    public String getDesc() {
        return desc;
    }
    public static PayStatus getValue(Integer value) {
        if (value == null) {
            return null;
        }
        for (PayStatus type: PayStatus.values()) {
            if (type.getValue() == value) {
                return type;
            }
        }
        return null;
    }
    public static String getDesc(Integer value) {
        if(getValue(value) == null){
            return null;
        }
        return getValue(value).getDesc();
    }
}
